import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:zhrs/Model/medicaremessage.dart';
import 'package:zhrs/mainpage/medicallayout.dart';
import 'package:zhrs/mainpage/swipter.dart';
import 'package:zhrs/Utils/windowsSize.dart';
import 'package:flutter/cupertino.dart';

class Medicare extends StatefulWidget
{

  Function reset;
  Medicare({this.reset});
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _Medicare();
  }
}

class _Medicare extends State<Medicare>
{

  @override
  Widget build(BuildContext context) {
    // TODO: implement build


    windowsSize.mapViewWidth = MediaQuery
        .of(context)
        .size
        .width;
    windowsSize.mapViewHeight = MediaQuery
        .of(context)
        .size
        .height;
   return   SafeArea(
       child: Scaffold (
         body:  new Container(
           child:  MediaQuery.removePadding(
                    removeTop: true,
               context: context,
                child: Container(
                       child: ListView(
                         children: <Widget>[
                           Container(

                             width: windowsSize.mapViewWidth ,
                                  height: 200 ,
                                  child: Stack(
                                    children: <Widget>[
                                      SwiperPage(),
                                          Container(
                                              height: windowsSize.mapViewHeight * 0.06,
                                                child: Row(
                                                    children: <Widget>[
                                                      Container(
                                                          padding: EdgeInsets.only(left: windowsSize.mapViewWidth * 0.005, top: 0),
                                                           child:Row(
                                                             children: <Widget>[
                                                                 Text("上海",style: TextStyle(color: Colors.white,fontSize: 17),),
                                                                Icon(Icons.keyboard_arrow_down,
                                                               size: windowsSize.mapViewWidth * 0.05,
                                                            color: Colors.white,),
                                          ],
                                       )
                                 ),
                                                                    Padding(
                                                                        padding:  EdgeInsets.fromLTRB(
                                                                         windowsSize.mapViewWidth * 0.02, 0,   windowsSize.mapViewWidth * 0.02, 0),
                                                                         child:    Container(
                                                                           width: windowsSize.mapViewWidth * 0.7,
                                                                               height: windowsSize.mapViewHeight * 0.04,
                                                                              child: Padding(
                                                                                   padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
                                                                                      child: TextField(
                                                                                          style: TextStyle(
                                                                                            fontSize: 15, color: Colors.black,),
                                                                                             decoration: InputDecoration(
                                                                                              hintStyle: TextStyle(color: Colors.white60),
                                                                                            contentPadding: EdgeInsets.all(5.0),
                                                                                            prefixIcon: Icon(Icons.search,color: Colors.white30,),
                                                                                             border: OutlineInputBorder(
                                                                                            borderRadius: BorderRadius.circular(60),
                                                                                           ),
                                                                                          filled: true,
                                                                               hintText: "请输入搜索内容",
                                                                              fillColor: Colors.white30,
                                                                          focusedBorder: OutlineInputBorder(
                                                                         borderRadius: BorderRadius.circular(60),
                                                                          borderSide: const BorderSide(color:Colors.white30)),
                                                                          enabledBorder: OutlineInputBorder(
                                                                           borderRadius: BorderRadius.circular(60),
                                                                         borderSide: const BorderSide(color:Colors.white30))
                                                                      ),
                                                                    ),
                                                                    ),
                                                                    ),
                                                                  ),
                                                           Container(
                                                               child: Icon(Icons.chat_bubble_outline,
                                                               size: windowsSize.mapViewWidth * 0.07,
                                                              color: Colors.white,),
                                                           ),
                                                    ],
                                                ),
                                          ),
                                    ],
                                  ),
                           ),
                           Opacity(
                             opacity: 0.4,
                             child:  Container(
                               width: windowsSize.mapViewWidth  ,
                               height: 15,
                               color: Colors.black12,
                             ) ,
                           ),
                           Padding(
                               padding:  EdgeInsets.only(),
                               child:  Container(
                                 width: windowsSize.mapViewWidth  ,
                                 child: Medicallayout(rowcount: 3,total:medicalmessagelist.length ,medicalmessagelists: medicalmessagelist,reset: widget.reset,),
                               )
                           ),
           ],
         ),
       )
    )
    )
    )
   );
  }
}